import { HashRouter, Routes, Route, Navigate } from "react-router-dom";
import { lazy, Suspense } from 'react'
const Index = lazy(() => import('../pages/index/index'));
const Manage = lazy(() => import('../pages/manage/manage'));
const UserList = lazy(() => import('../pages/management/userList/userList'));
const ShopList = lazy(() => import('../pages/management/shopList/shopList'));
const FoodList = lazy(() => import('../pages/management/foodList/foodList'));
const OrderList = lazy(() => import('../pages/management/orderList/orderList'));
const AdminList = lazy(() => import('../pages/management/adminList/adminList'));
const AddShop = lazy(() => import('../pages/addmanagement/addShop/addShop'));
const AddGoods = lazy(() => import('../pages/addmanagement/addGoods/addGoods'));
const Visitor = lazy(() => import('../pages/Chart/visitor/visitor'));
const VueEdit = lazy(() => import('../pages/edit/vueEdit/vueEdit'));
const AdminSet = lazy(() => import('../pages/set/adminSet/adminSet'));
const Explain = lazy(() => import('../pages/explain/explain'));

const BasicRoute = () => (
    <HashRouter>
        <Suspense fallback={''}>
            <Routes>
                <Route path="/" element={<Navigate to='/manage'></Navigate>}></Route>
                <Route path='/' element={< Index />}>
                    <Route path='/manage' element={<Manage />}></Route>
                    <Route path='/userList' element={<UserList />}></Route>
                    <Route path='/shopList' element={<ShopList />}></Route>
                    <Route path='/foodList' element={<FoodList />}></Route>
                    <Route path='/orderList' element={<OrderList />}></Route>
                    <Route path='/adminList' element={<AdminList />}></Route>
                    <Route path='/addShop' element={<AddShop />}></Route>
                    <Route path='/addGoods' element={<AddGoods />}></Route>
                    <Route path='/visitor' element={<Visitor />}></Route>
                    <Route path='/addShop' element={<AddShop />}></Route>
                    <Route path='/vueEdit' element={<VueEdit />}></Route>
                    <Route path='/adminSet' element={<AdminSet />}></Route>
                    <Route path='/explain' element={<Explain />}></Route>
                </Route>
            </Routes>
        </Suspense>
    </HashRouter>
);
export default BasicRoute;